package asia.yuanding.wechat.web.netty.handler;

import asia.yuanding.wechat.system.util.R;
import cn.hutool.json.JSONObject;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.stereotype.Service;

/**
 * @ClassName: PingHandler
 * @Author: YuanDing
 * @Date: 2025/8/4 21:02
 * @Description:
 */

@Service
public class HeartbeatHandler implements MessageHandlerUtil {
    @Override
    public String getType() {
        return "heartbeat";
    }

    @Override
    public void handle(ChannelHandlerContext ctx, JSONObject data) {
        ctx.writeAndFlush(MessageHandlerUtil.getResult(R.ok("pong")));
    }
}
